1. Field of the Invention
The present invention relates to a technology for collecting information on an execution status of a program using an interrupt handler that is activated by an interrupt generated when a predetermined condition is satisfied.
2. Description of the Related Art
Profiling techniques are widely used in computer systems to analyze and optimize performance. Profiling is effective in analysis of tracking frequency and time distribution of a target program code, call relationship frequency within the program, and the like. Conventionally, there are two types of profiling techniques.
One technique uses a method of inserting a code for profiling into a compiler and extracting execution information (see FIG. 10A). This profiling technique is most widely used, and is included as a standard function in compiler products. Several methods for improving efficiency of data extraction using this technique have been proposed (see, for example, Japanese Patent Application Laid-Open No. H11-212837 and Japanese Patent Application Laid-Open No. 2003-140928).
Another profiling technique is a sampling method using a hardware timer and a central processing unit (CPU) performance monitoring function (see FIG. 10B). In this technique, a sampling interrupt is generated at regular periods or every time the measurable number of commands executed by a processor and its peripheral circuits, the number of cache misses, and the like, reaches a fixed number. A code range that has statistically consumed most time, a code range that has been executed most frequently, and the like, are extracted by registering an executed command address and the like when an interrupt is generated by a profiling processing program that is registered as an interrupt process.
However, the former technique of inserting a profiling code into a compiler has problems of creating a temporal overhead due to additional profiling processing to the overall target code, or of creating dynamic disparity or memory layout disparity with the original program binary due to the insertion of the code. Differences with the original operation are particularly common in programs where the timing of communications and the like is important, and use of this method is limited depending on required precision.
Although the latter profiling technique using sampling can minimize these problems of overhead and memory layout since it does not require alteration of the target code, it cannot acquire a path to the execution command address and its call relationship with the program at the time of sampling. For example, if a library function A has the longest execution time, there are normally plural codes for calling the library function A, and a code section can also be called from a plurality of sources. According to this technique, there is no method of efficiently acquiring detailed operation information relating to such call sources, dependency relationships, and the like.